﻿using RXY_Mall.Domain;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace RXY_Mall.AdminApi.Models
{
    /// <summary>
    /// 订单列表输出信息
    /// </summary>
    public class GetReturnListOutput
    {
        internal DateTime add_time;
        internal string json_specs;

        /// <summary>
        /// 退换货号
        /// </summary>
        public string return_no { get; internal set; }
        /// <summary>
        /// 店铺信息
        /// </summary>
        public ShopOutput shop { get; set; }
        /// <summary>
        /// 商品信息
        /// </summary>
        public GoodsOutput goods { get; set; }
        /// <summary>
        /// 退换货状态
        /// </summary>
        public ReturnStatus return_status { get; internal set; }
        /// <summary>
        /// 实付
        /// </summary>
        public string order_amount { get; internal set; }
        /// <summary>
        /// 退款金额
        /// </summary>
        public string return_amount { get; internal set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public long create_time { get; set; }
        /// <summary>
        /// 退换货类型
        /// </summary>
        public ReturnType return_type { get; internal set; }
    }

    public class GetReturnOutput
    {
        internal DateTime add_time;
        internal DateTime? expire_time;
        internal DateTime? audit_pass_time;
        internal DateTime? audit_fail_time;
        internal DateTime? user_shipment_time;
        internal DateTime? shop_receive_time;
        internal DateTime? shop_refund_time;
        internal DateTime? shop_shipment_time;
        internal DateTime? user_receive_time;
        internal DateTime? complete_time;
        internal DateTime? cancel_time;
        internal gw_return_audit gw_return_audit;

        public GetReturnOutput()
        {
            process = new List<ProcessItem>();
        }

        /// <summary>
        /// 退换单号
        /// </summary>
        public string return_no { get; set; }
        /// <summary>
        /// 订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public ReturnStatus return_status { get; set; }
        /// <summary>
        /// 订单金额
        /// </summary>
        public string order_amount { get; set; }
        /// <summary>
        /// 退款金额
        /// </summary>
        public string refund_amount { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public long return_create_time { get; set; }
        /// <summary>
        /// 过期时间
        /// </summary>
        public long return_expire_time { get; set; }
        /// <summary>
        /// 商家审核通过时间
        /// </summary>
        public long merchant_audit_pass_time { get; set; }
        /// <summary>
        /// 商家审核失败时间
        /// </summary>
        public long merchant_audit_fail_time { get; internal set; }
        /// <summary>
        /// 买家发货时间
        /// </summary>
        public long buyer_shipment_time { get; set; }
        /// <summary>
        /// 商家收货时间
        /// </summary>
        public long merchant_receive_time { get; set; }
        /// <summary>
        /// 商家退款时间
        /// </summary>
        public long merchant_refund_time { get; internal set; }
        /// <summary>
        /// 商家发货时间
        /// </summary>
        public long merchant_shipment_time { get; internal set; }
        /// <summary>
        /// 买家收货时间
        /// </summary>
        public long buyer_receiver_time { get; internal set; }
        /// <summary>
        /// 完成时间
        /// </summary>
        public long return_complete_time { get; internal set; }
        /// <summary>
        /// 取消时间
        /// </summary>
        public long return_cancel_time { get; internal set; }
        /// <summary>
        /// 店铺信息
        /// </summary>
        public ShopOutput shop { get; internal set; }
        /// <summary>
        /// 订单商品
        /// </summary>
        public OrderGoods goods { get; set; }
        /// <summary>
        /// 买家运单信息
        /// </summary>
        public Waybill buyer_waybill { get; set; }
        /// <summary>
        /// 商家运单信息
        /// </summary>
        public Waybill merchant_waybill { get; set; }
        /// <summary>
        /// 申请信息
        /// </summary>
        public ReturnRequest request { get; internal set; }
        /// <summary>
        /// 审核信息
        /// </summary>
        public ReturnAudit audit { get; set; }
        /// <summary>
        /// 进度
        /// </summary>
        public List<ProcessItem> process { get; set; }
        
    }

    /// <summary>
    /// 进度项
    /// </summary>
    public class ProcessItem
    {
        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 内容
        /// </summary>
        public string content { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public long date { get; set; }
    }

    /// <summary>
    /// 商家审核
    /// </summary>
    public class ReturnAudit
    {
        /// <summary>
        /// 是否通过
        /// </summary>
        public bool is_pass { get; set; }
        /// <summary>
        /// 审核说明
        /// </summary>
        public string audit_note { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 审核时间
        /// </summary>
        public long add_time { get; set; }
    }

    /// <summary>
    /// 申请信息
    /// </summary>
    public class ReturnRequest
    {
        /// <summary>
        /// 退换货类型
        /// </summary>
        public ReturnType return_type { get; set; }
        /// <summary>
        /// 退换货原因
        /// </summary>
        public ReturnReason return_reason { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 联系人
        /// </summary>
        public string contact_name { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string contact_mobile { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public long add_time { get; set; }
    }

    /// <summary>
    /// 退换货请求接口
    /// </summary>
    public class ReturnInput : BaseInput
    {
        /// <summary>
        /// 订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 退换货类型
        /// </summary>
        public ReturnType return_type { get; set; }
        /// <summary>
        /// 退换货原因
        /// </summary>
        public ReturnReason return_reason { get; set; }
        /// <summary>
        /// 退换货说明
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string contact_mobile { get; set; }
        /// <summary>
        /// 照片
        /// </summary>
        public List<string> pictures { get; set; }

    }

    /// <summary>
    /// 取消订单输入信息
    /// </summary>
    public class CancelReturnInput : BaseInput
    {
        /// <summary>
        /// 订单号
        /// </summary>
        public string return_no { get; set; }
    }

    /// <summary>
    /// 添加运单输入信息
    /// </summary>
    public class AddWaybillInput : CancelReturnInput
    {
        /// <summary>
        /// 运单号
        /// </summary>
        [Required(ErrorMessage = "物流单号不能为空")]
        public string waybill_no { get; set; }
        /// <summary>
        /// 物流公司
        /// </summary>
        [Required(ErrorMessage = "物流公司不能为空")]
        public string company_name { get; set; }

    }

}